package com.example.yilanchatserver.application.controller;

import com.example.yilanchatserver.business.oss.dto.FileVO;
import com.example.yilanchatserver.business.oss.service.OssService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
@RequestMapping("/metah/oss")
public class OssController {

    @Resource
    private OssService ossService;

    @PostMapping("/uploadFile")
    public FileVO uploadOssFile(MultipartFile file, String dirCode) {
        return ossService.uploadFile(file, dirCode);
    }
}
